import React, { useState } from 'react';
import { View } from '@tarojs/components';
import { ImagePreview } from '@nutui/nutui-react-taro';

interface ImagePreviewProps {
  images: string[]; // 图片数组
  visible: boolean; // 是否显示预览
  onClose: () => void; // 关闭预览的回调函数
}

const ImagePreviewComponent: React.FC<ImagePreviewProps> = ({ images, visible, onClose }) => {
  return (
    <ImagePreview
      autoPlay
      images={images}
      visible={visible}
      onClose={onClose}
      indicator
    />
  );
};

export default ImagePreviewComponent;